package com.zyh;

import com.zyh.um.UserApplication;
import com.zyh.um.dao.UserDao;
import com.zyh.um.entity.User;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import javax.annotation.Resource;

@RunWith(SpringRunner.class)
@SpringBootTest(classes = UserApplication.class)
public class test {
    @Resource
    private UserDao service;

    @Test
    public void test1(){
        User user = new User();
        user.setName("xiaohei");
        user.setPassword("123456");
        User user1 = service.queryUserByNameAndPassword(user);
        System.out.println("user1 = " + user1);
    }
}
